Multitasking means that a single computer system simultaneously executes a plurality of tasks, i.e., a plurality of processes realized by a plurality of programs. However, since a computer system having a single program execution mechanism can execute only a single task at an instant, another control mechanism such as an OS (Operating System) causes the program execution mechanism to alternately execute a plurality of tasks at extremely short intervals. This gives an illusion to users as if the plurality of tasks are executed simultaneously.
As a method for realizing this multitasking, there has been conventionally known the round robin method in which a plurality of tasks are cyclically executed in accordance with a predetermined time period allotted to each of the tasks. If a time period allotted to a task for a program execution mechanism (hereinafter “time slice”) runs out, the execution of the task is temporarily suspended. Then, the order of executing the tasks is rescheduled. When a turn of the task comes again, the execution of the rest of the task is restarted.
When the execution of the task is temporarily suspended, control information (hereinafter a “context”) held in various registers (hereinafter “register group”) needed for the execution is stored in a memory. When the execution is restarted, the context stored in the memory is stored in the register groups and the execution is restarted from a suspended point.
Regarding this multitasking, Japanese Patent Application Publication No. 2003-271399 discloses an art for avoiding waste of a program execution mechanism to execute a plurality of tasks efficiently by performing switching between a plurality of register groups. In this art, while a task is being executed using one of the register groups, a context of a task to be executed next is stored beforehand in another one of the register groups. As soon as an execution time period allotted to the task being executed using the one register group ends, the task to be executed next is executed using the another one register group. In this way, efficiency in executing a plurality of tasks is increased.